package com.sz.framework.log.slf4j;

import com.sz.framework.log.SzLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 框架日志与Slf4j日志的转换器
 *
 * @author: yxl
 * 2025-07-24
 */
public class SzLogToSlf4jAdapter implements SzLog {

    private final Logger logger;

    protected SzLogToSlf4jAdapter(Class<?> clazz) {
        this.logger = LoggerFactory.getLogger(clazz);
    }

    protected SzLogToSlf4jAdapter(String name) {
        this.logger = LoggerFactory.getLogger(name);
    }

    @Override
    public void trace(String str, Object... args) {
        logger.trace(str, args);
    }

    @Override
    public void debug(String str, Object... args) {
        logger.debug(str, args);
    }

    @Override
    public void info(String str, Object... args) {
        logger.info(str, args);
    }

    @Override
    public void warn(String str, Object... args) {
        logger.warn(str, args);
    }

    @Override
    public void error(String str, Object... args) {
        logger.error(str, args);
    }

    @Override
    public void error(String str, Throwable throwable) {
        logger.error(str, throwable);
    }

    @Override
    public void fatal(String str, Object... args) {
        logger.error(str, args);
    }
}
